<template>
	<view class="u-padding-20">
		<view class="u-font-xl bold muted">您的每一次真挚建议，对我们而言都是无比珍贵的宝藏。</view>

		<view class="bg-white u-padding-left-20 u-padding-right-20 u-padding-bottom-20 u-margin-top-30 u-border-radius-10">
			<u-field v-model="name"  label="姓名" placeholder="请填写姓名">
			</u-field>
			<u-field v-model="mobile" :border-bottom="false" label="手机号" placeholder="请填写手机号">
			</u-field>
			<u-input v-model="content" type="textarea" placeholder="请描述您的建议" :height="180"
				style="background-color: #F7F8FA;padding: 10rpx;border-radius: 10rpx;" />
		</view>
		
		<u-button type="primary" class="mt30" :custom-style="{backgroundColor: '#4990fa'}" @click="calculate">提交</u-button>
	</view>
</template>

<script>
	import {
		addFeedback
	} from '@/api/app'
	export default {
		data() {
			return {
				name:'',
				mobile:'',
				content:'',
			};
		},
		methods:{
			calculate(){
				var _this = this;
				addFeedback({
					name:this.name,
					mobile:this.mobile,
					content:this.content,
				}).then(res => {
					_this.$u.toast(res.msg);
					if(res.code == 1){
						setTimeout(()=>{
							uni.reLaunch({
								url:'/pages/index/index'
							})
						},500)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.u-border-radius-10 {
		border-radius: 10rpx;
	}
</style>